$(window).on('load',function(){
    apiready = function() {
        var img = $api.dom('#img');
        var src = 'data:image/jpg;base64,'+api.pageParam.base64str;
        $api.attr(img,'src',src);
    }
});

function closeFrame() {
    api.closeFrame();
}